stage.set_background("park")
sprite = codesters.Sprite("person3")
sprite.glide_to(-100, 50)
# text = codesters.Text("text", x, y, "color")
text = codesters.Text("I went to the park!", 0, -200, "blue")
stage.wait(1)
sprite.move_right(400)
t = codesters.Teacher()
try:
tval1 = t.find_function('ask')[0][1]
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success('transition1' in tval1 and 'choose' in tval1.lower(), "Great job!")
t1.add_failure(tval1 == "DNE", "Did you add an Ask command?")
t1.add_failure('choice' in tval1, "Did you change the variable name choice to transition1?")
t1.add_failure('yes' in tval1.lower(), "Did you change the string in your ask so that the user chooses a transition?")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
提交作品
-
下个活动
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)